package io.afu.baseframework.annotations;

import io.afu.baseframework.annotations.impls.LimitedOnlyImpl;
import io.afu.baseframework.constants.ValidateConst;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.ANNOTATION_TYPE,ElementType.FIELD,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {LimitedOnlyImpl.class})
public @interface LimitedOnly {

    String message() default ValidateConst.PARAM_NOT_IN_THE_LIST;


    // 优先级最高
    String[] limit() default {};


    // 优先级最低
    Class limitClass() default Object.class;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default{};

    boolean allowEmpty() default false;

}
